Skip to content

Conversation

@kpavlov
Copy link
Contributor

@kpavlov kpavlov commented Oct 23, 2025

  • Add convenience constructors to JSONRPCRequest
  • Make UUID string a default JSONRPCRequest

Motivation and Context

To create request objects more easily

How Has This Been Tested?

Unit tests

Breaking Changes

No, this is a new API

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@kpavlov kpavlov requested a review from devcrocod October 23, 2025 16:21
@kpavlov
Copy link
Contributor Author

kpavlov commented Oct 24, 2025

need to rebase and run apiDump again

@kpavlov kpavlov force-pushed the kpavlov/JSONRPCRequest-constructors branch from 36a0d0e to 8909dee Compare November 3, 2025 20:17
@kpavlov kpavlov marked this pull request as ready for review November 3, 2025 20:21
@kpavlov kpavlov marked this pull request as draft November 3, 2025 20:26
@kpavlov kpavlov marked this pull request as ready for review November 3, 2025 20:55
@kpavlov kpavlov requested a review from devcrocod November 3, 2025 20:55
@kpavlov kpavlov force-pushed the kpavlov/JSONRPCRequest-constructors branch from 878d595 to 9e78bda Compare November 5, 2025 09:59
@tiginamaria tiginamaria self-requested a review November 6, 2025 09:48
tiginamaria
tiginamaria previously approved these changes Nov 6, 2025
Copy link
Contributor

@tiginamaria tiginamaria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nicer now! Thank you!

@kpavlov kpavlov marked this pull request as draft November 6, 2025 10:50
@kpavlov
Copy link
Contributor Author

kpavlov commented Nov 6, 2025

set to draft to avoid conflicts with @devcrocod's changes

…t-constructors

# Conflicts:
#	kotlin-sdk-client/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/client/StreamableHttpClientTransportTest.kt
#	kotlin-sdk-core/api/kotlin-sdk-core.api
#	kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types.kt
- Updated `JSONRPCRequest` with new string and numeric ID constructors.
- Replaced atomic ID handling with UUID defaults.
- Enhanced test coverage for JSONRPCRequest creation scenarios.
@kpavlov kpavlov marked this pull request as ready for review November 18, 2025 15:20
Copy link
Contributor

@devcrocod devcrocod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The request id is used to store handlers, and it’s also used as a progress token. Are you sure this change won’t break tracking of previous requests or progress notifications?

@kpavlov
Copy link
Contributor Author

kpavlov commented Nov 18, 2025

I am worrying that it is much harder to guarantee uniqueness of numeric field. UUID is a proven solution for such cases and migrating to UUID should be safe. Even more, we should switch from String to UUID internally to guarantee ID uniqueness.

@devcrocod
Copy link
Contributor

Even more, we should switch from String to UUID internally to guarantee ID uniqueness.

No, we can receive and process ids from various servers and clients (not only ours)

Copy link
Contributor

@devcrocod devcrocod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kpavlov kpavlov merged commit 6dd9c80 into main Nov 20, 2025
4 of 5 checks passed
@kpavlov kpavlov deleted the kpavlov/JSONRPCRequest-constructors branch November 20, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants